//
//  DCXMPPTool.h
//  xmppBase
//
//  Created by striby on 16/1/7.
//  Copyright © 2016年 com.dc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "XMPPFramework.h"
#import <CoreData/CoreData.h>
#import "XMPPRosterMemoryStorage.h"
#import "XMPPIncomingFileTransfer.h"
#import "XMPPOutgoingFileTransfer.h"
#import "XMPPvCardTemp.h"
#import "XMPPvCardTempModule.h"
#import "XMPPvCardCoreDataStorageObject.h"


/**
 *  notification
 */
#define kXMPP_MESSAGE_CHANGE    @"kXMPP_MESSAGE_CHANGE"

#define kLoginAndAuthenticateSuccessed @"kLoginAndAuthenticateSuccessed"
#define kXmppUserLogout @"kUserLogout"

#define kFriendShipStatusChanged @"kFriendShipStatusChanged"

#define kXmppRegiserSuccessed @"kXmppRegiserSuccessed"

#define kXmppRegiserFailed @"kXmppRegiserFailed"

#define kXmppMyInfoChanged @"kXmppMyInfoChanged"

#define kXmppUserInfoGetSuccessed @"kXmppUserInfoGetSuccessed"

typedef enum _XmppConnectionStatus
{
    XmppConnectionStatusLogin=0,
    XmppConnectionStatusRegister=1
}XmppConnectionStatus;

@interface DCXMPPTool : NSObject<XMPPStreamDelegate>

@property(nonatomic,strong)dispatch_queue_t imQue;


+(DCXMPPTool*)shareInstance;

/**
 *  连接状态
 */
@property (nonatomic,assign)XmppConnectionStatus connectionStatus;

////////////////////////////////////////////////////////
////////////////////////////////////////////////////////

@property (nonatomic, strong) XMPPStream *xmppStream;
@property (nonatomic, strong) XMPPRosterCoreDataStorage *xmppRosterStorage;
@property (nonatomic, strong) XMPPRoster *xmppRoster;
@property (nonatomic, strong) XMPPReconnect *xmppReconnect;
@property (nonatomic, strong) XMPPMessageArchivingCoreDataStorage *xmppMessageArchivingCoreDataStorage;
@property (nonatomic, strong) XMPPMessageArchiving *xmppMessageArchivingModule;
@property (nonatomic, strong) XMPPRosterMemoryStorage *xmppRosterMemoryStorage;
@property (nonatomic, strong) XMPPIncomingFileTransfer *xmppIncomingFileTransfer;

@property(nonatomic,strong)NSDictionary * userinfo;

// 声明上传头像相关对象

@property (nonatomic , strong) XMPPvCardCoreDataStorage *xmppvCardStorage;

@property (nonatomic , strong) XMPPvCardTempModule *xmppvCardTempModule;

@property (nonatomic , strong) XMPPvCardAvatarModule *xmppvCardAvatarModule;

// 在线状态
@property (nonatomic, strong) XMPPPresence *receivePresence;

////////////////////////////////////////////////////////
////////////////////////////////////////////////////////

/**
 *  添加好友
 */
-(void)addFriendWithUserJid:(XMPPJID *)jid;

/**
 *  删除好友
 */
-(void)deletaFriendWithUserJid:(XMPPJID*)jid;

/**
 *  连接
 */
-(BOOL)connectXmppHost;

/**
 *  注销
 */
-(void)logoutXmppHost;


@end
